




//
//  MBHouseReleaseVC.m
//  发布求租
//
//  Created by MB__Lee on 2018/6/10.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "MBHouseReleaseVC.h"

#import "MBTianXieCell.h" // 填写
#import "MBIMSelectedVC.h"

@interface MBHouseReleaseVC ()<UITableViewDelegate,UITableViewDataSource,MBIMSelectedVCDelegate>


@property(nonatomic,strong)UITableView *tableview;

@property(nonatomic,strong)NSIndexPath *indexPath;

@property(nonatomic,strong)MBCommonCellModel *model;

@end


static NSString *MBTianXieCell_identi = @"MBTianXieCell"; //填写信息cell
static NSString *MBCircleBTNCell_identi = @"MBCircleBTNCell"; // 选择类型--第一个cell，点击可以切换vc
@implementation MBHouseReleaseVC

-(UITableView *)tableview{
    if (!_tableview) {
        UITableView *tableview = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _tableview  = tableview;
        tableview.delegate = self;
        tableview.dataSource = self;
        
        
        
        [tableview registerNib:[UINib nibWithNibName:MBTianXieCell_identi bundle:nil] forCellReuseIdentifier:MBTianXieCell_identi];
        
    }
    return  _tableview;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return  1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    MBBaseFBQCell *cell  = [tableView dequeueReusableCellWithIdentifier:MBTianXieCell_identi];
    cell.CMModel = _model;
    NSLog(@"reload=========");
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return  cell;
    
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return  94;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    _indexPath = indexPath;
    MBIMSelectedVC *vc = [[MBIMSelectedVC alloc] init];
    vc.delegate = self;
    
    [self.navigationController pushViewController:vc animated:YES];
    
}

#pragma mark ---MBIMSelectedVCDelegate
-(void)MBIMSelectedVC:(MBIMSelectedVC *)vc sendImage:(UIImage *)image{
    
    _model.xuanze = @"选择";
    
    
    [self.tableview reloadData];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.tableview];
}
-(void)setSourceMut:(NSMutableArray *)sourceMut{
    _sourceMut = sourceMut;
    _model  =[[MBCommonCellModel alloc] init];
    _model.PHTest = @"未选择";
//    _model.xuanze = @"选择";
    _model.title = @"填写信息";
    _model.subtitle = @"产权证明";
    NSLog(@"%@",_model);
    
    [self.tableview reloadData];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
